package cn.com.se.sharepictrue;

import android.app.Application;
import android.content.Context;

import com.google.gson.Gson;
import com.squareup.leakcanary.LeakCanary;
import com.squareup.leakcanary.RefWatcher;

import cn.com.se.sharepictrue.utils.BusinessUtils;

/**
 * Created by KIDNG on 2015/11/14.
 */
public class AppContext extends Application {
    private static Context instance;


    private static Gson gson = new Gson();
    private RefWatcher refWatcher;

    @Override
    public void onCreate() {
        super.onCreate();

        instance = getApplicationContext();
        refWatcher = LeakCanary.install(this);
         initAsyncHttpUtil();
    }
    /**
     * Return a singleton app context.
     */
    public static Context getInstance() {
        return instance;
    }
    public static Gson getGson(){return gson;}
    private void initAsyncHttpUtil() {
        BusinessUtils.setPersistentCookieStore(instance);
    }
}
